package com.eagle.videoboot.utils;


import com.eagle.videoboot.domain.vo.ResultVO;
import com.eagle.videoboot.enums.ResultEnum;

public class ResultVOUtil {

    public static ResultVO success(Object object) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode("00000");
        resultVO.setMsg("success");
        resultVO.setData(object);
        return resultVO;
    }

    public static ResultVO success() {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode("00000");
        resultVO.setMsg("success");
        return resultVO;
    }

    public static ResultVO error(ResultEnum resultEnum) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(resultEnum.getCode());
        resultVO.setMsg(resultEnum.getMessage());
        return resultVO;
    }
    public static ResultVO error(String errMsg) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode("A0001");
        resultVO.setMsg(errMsg);
        return resultVO;
    }

	public static ResultVO error(String errCode, String errMsg) {
		ResultVO resultVO = new ResultVO();
		resultVO.setCode(errCode);
		resultVO.setMsg(errMsg);
		return resultVO;
	}
}
